#ifndef SSHCLIENT_H
#define SSHCLIENT_H

#include "libssh2/include/libssh2_sftp.h"
#include <QObject>

class sshClient : public QObject
{
    Q_OBJECT
public:
    explicit sshClient(QObject *parent = nullptr);

    void copyFolder(QString strRemoteIP, QString strRemoteUser, QString strRemotePwd, QString remoteFolder, QString localFolder);
signals:
    void copySignal(QString strRemoteIP, QString strRemoteUser, QString strRemotePwd, QString remoteFolder, QString localFolder);
    void copyError(QString strErr);
    void copyOK();
private slots:
    void copy(QString strRemoteIP, QString strRemoteUser, QString strRemotePwd, QString remoteFolder, QString localFolder);
protected:
    bool _copyFolder(LIBSSH2_SFTP *sftp_session,QString remoteFolder, QString localFolder);
private:
    bool m_bRun; //用于中途取消

};

#endif // SSHCLIENT_H
